home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ada
/
c01lab4.zip
/
LRMRDR
/
LRM_CODE.ZIP
/
LRM.A
< prev
next >
Wrap
Text File
|
1992-05-29
|
61KB
|
1,714 lines
--::::::::::
--copyrite.ada
--::::::::::
-- ***********************************************************************
-- ON-LINE Ada LANGUAGE REFERENCE MANUAL by Richard Conn
--
-- COPYRIGHT NOTICE
-- Ada LRM Reader - Interactive Presentation of the Ada LRM
-- Copyright (C) 1992 Richard Conn
--
-- This program is free software; you can redistribute it
-- and/or modify it under the terms of the GNU General Public
-- License Version 1 as published by the Free Software
-- Foundation.
--
-- This program is distributed in the hope that it will be
-- useful, but WITHOUT ANY WARRANTY; without even the implied
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-- PURPOSE. See the GNU General Public License for more
-- details. You should have received a copy of the GNU General
-- Public License along with this program; if not, write to the
-- Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
-- 02139, USA. See the ABOUT screens for further information,
-- including information on how to contact the author.
--::::::::::
--command.ads
--::::::::::
-- ***********************************************************************
-- ON-LINE Ada LANGUAGE REFERENCE MANUAL by Richard Conn
with Citation_Definition;
package Command_Dispatcher is
function Convert_Citation (CitS : in STRING)
return Citation_Definition.CITATION_ID;
-- Convert the indicated string ("n.n.n" or "keyword") to CITATION_ID
procedure View_Help;
-- View help citation and then Dispatch (Citation_Definition.USER_INPUT)
procedure Dispatch (Current_Citation : in Citation_Definition.CITATION_ID);
-- Dispatch Current_Citation as first command and continue with
-- USER_INPUT until command is QUIT
end Command_Dispatcher;
--::::::::::
--display.ads
--::::::::::
-- ***********************************************************************
-- ON-LINE Ada LANGUAGE REFERENCE MANUAL by Richard Conn
with SYSDEP;
with Citation_Definition;
with DAF_Handler;
with System; -- standard Ada environment
with Console; -- CS Parts
package Screen_Display_Controller is
type ERROR_MESSAGE_ID is (INVALID_COMMAND,
CANNOT_ADVANCE, CANNOT_BACK,
STACK_EMPTY, STACK_FULL,
PRINT_LOG,
TOO_MANY_SCREENS,
SEARCH_STRING,
DAF_NOT_FOUND,
INTERNAL_DAF_NDFO_ERROR,
INTERNAL_DAF_RE_ERROR,
INTERNAL_DAF_SO_ERROR,
INTERNAL_DAF_UE_ERROR,
UNEXPECTED_ERROR);
-- Kinds of error messages which may be displayed
type SCREEN_BUFFER is array (NATURAL'(1)..SYSDEP.Text_Line_Count) of
DAF_Handler.LINE;
-- Lines associated with a screen
type SCREEN_BUFFER_POINTER is access SCREEN_BUFFER;
-- Pointer to a screen buffer so the full buffer does not have to be
-- passed
subtype LINE_NUMBER is NATURAL
range NATURAL(Console.ROW_NUMBER'FIRST) ..
NATURAL(Console.ROW_NUMBER'LAST);
-- Valid line number from Console.ROW_NUMBER
procedure Show_Text;
-- Clear screen and display the text area
procedure Mark_Line (Number : in LINE_NUMBER);
-- Place a mark on the indicated line
procedure Show_Prompt;
-- Display prompt on command line; if Search_String is null, do not
-- display it; clear error message if one is present after one call
-- to Show_Prompt
procedure Show_Error (Item : in ERROR_MESSAGE_ID);
-- Display error message
procedure Print_Log_File_Closed_Message;
-- Print the message that the indicated print log file is closed
function Convert (SB_Address : in System.ADDRESS) return
SCREEN_BUFFER_POINTER;
-- Given the address of a screen buffer object, return a pointer to it
function Citation_to_Display (CitX : in Citation_Definition.CITATION_ID)
return STRING;
-- Given a citation ID, return a string of the form "n.n.n" or "keyword"
end Screen_Display_Controller;
--::::::::::
--pcit.ads
--::::::::::
-- ***********************************************************************
-- ON-LINE Ada LANGUAGE REFERENCE MANUAL by Richard Conn
with SYSDEP;
with Citation_Definition;
with Screen_Display_Controller;
package Primitive_Citation_Handler is
subtype SEARCH_STRING is STRING (1..SYSDEP.Screen_String_Length);
-- Statistics on current citation
type CITATION_STATISTICS is record
ID : Citation_Definition.CITATION_ID;
Current_Screen_Number : NATURAL;
Total_Number_of_Screens : NATURAL;
Stack_Level : NATURAL;
Search_Str : SEARCH_STRING;
Search_Last : NATURAL; -- index of last char in Search_Str
Search_May_Be_Continued : BOOLEAN;
end record;
-- Status of a search request
type SEARCH_STATUS is record
Is_Found : BOOLEAN; -- TRUE if string was found
Found_on_Screen : NATURAL; -- if found, screen string was found on
Found_on_Line : NATURAL; -- if found, line string was found on
end record;
-- Exceptions:
SCREEN_COUNT_OVERFLOW : exception;
-- raised if number of screens exceeds SYSDEP.Max_Number_of_Screens
-- raised by Open_New_Citation
function DAF_File_Name (ITEM : in Citation_Definition.CITATION_ID)
return STRING;
-- Return the name of the *.daf file associated with a given CITATION_ID
procedure Open_New_Citation (ID : in Citation_Definition.CITATION_ID);
-- Open a new citation for processing, closing the old one if
-- necessary; set the current screen to the first screen;
-- build an array of information on the screens
function Push return BOOLEAN;
-- Push the stack, returning TRUE if OK
function Pop return BOOLEAN;
-- Pop the stack, returning TRUE if OK
-- Screen Buffer is loaded appropriately
procedure Load_Screen_Buffer;
-- Load the screen buffer with the current screen
function Next_Screen return BOOLEAN;
-- Advance to the next screen, returning TRUE if done;
-- if at last screen of current citation, advance to the first screen
-- of the next citation
-- Screen Buffer is loaded appropriately
function Previous_Screen return BOOLEAN;
-- Back up to the previous screen, returning TRUE if done;
-- if at first screen of current citation, back up to last screen
-- of previous citation
-- Screen Buffer is loaded appropriately
function Next_Citation return BOOLEAN;
-- Advance to the first screen of the next citation, returning TRUE
-- if done Screen Buffer is loaded appropriately
function Previous_Citation return BOOLEAN;
-- Back up to the first screen of the previous citation, returning TRUE
-- if done
-- Screen Buffer is loaded appropriately
function Search_First (Item : in STRING) return SEARCH_STATUS;
-- Search for the Item from the beginning of the citation;
-- if Item is an empty string, resume search for last item requested
function Search_Next (Item : in STRING) return SEARCH_STATUS;
-- Resume search for Item from the next line in the citation;
-- if Item is an empty string, resume search for last item requested
function Current_Citation return CITATION_STATISTICS;
-- Return the statistics on the current citation
procedure Close_All_Open_Citations;
-- Close all open citation files
procedure Suspend;
-- Suspend operation for Print_Log
procedure Resume;
-- Resume operation for Print_Log
function Access_Screen
return Screen_Display_Controller.SCREEN_BUFFER_POINTER;
-- Return the address of the screen for printing or displaying
end Primitive_Citation_Handler;
--::::::::::
--cithandl.ads
--::::::::::
-- ***********************************************************************
-- ON-LINE Ada LANGUAGE REFERENCE MANUAL by Richard Conn
with Citation_Definition;
package Citation_Handler is
-- Abstract state machine for selecting and working with a given citation
procedure View_Citation